#ifndef DEFINE_H
#define DEFINE_H

#define FREQ_PWM 50        //50hz pwm波
#define RESOLUTION_PWM 10  //2的十次方 1024c

// 引脚类型
enum PinType {
  PIN_PENDING = -1,  // 待定状态

  PS2_DAT = 22,   
  PS2_CMD = 23,   
  PS2_SEL = 19,  
  PS2_CLK = 21,  

  WHEEL_L_T_FORWARD_PIN = 13,     
  WHEEL_L_T_REVERSE_PIN = 12,     
  WHEEL_L_B_FORWARD_PIN = 14,     
  WHEEL_L_B_REVERSE_PIN = 27,     
  WHEEL_R_T_FORWARD_PIN = 26,     
  WHEEL_R_T_REVERSE_PIN = 25,     
  WHEEL_R_B_FORWARD_PIN = 33,     
  WHEEL_R_B_REVERSE_PIN = 32      
};

// 方向
enum DirectionType {
  STOP = 0,    
  FORWARD = 1, 
  REVERSE = 2  
};

//操作状态
enum OperateStatus {
  SUCCESS,   
  ERROR,     
  BEPENDING  
};

//操作设备类型
enum OperateDeviceType {
  HANDLE = 1,        
  NETDEVICE = 2,     
};

// 手柄数据
typedef struct {
  int radius;
  int x; 
  int y; 
  bool leftRotation;
  bool leftSlide;
  bool rightRotation;
  bool rightSlide;
} PS2XData;

#endif // DEFINE_H